<template>
  <div class="else-box">
    <div class="wrap">
      <ul>
        <li class="else-img" v-for="(item, index) in imgArr" :key="index">
          <a href="##">
            <img :src="item" alt="" />
          </a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      imgArr: [],
    };
  },
  mounted() {
    this.$api.HomeOther().then((res) => {
      if (res.status === 200) {
        // 这个不稳定 有时候会请求不上
        var arr = res.data.otherImgs;
        for (var i = 0; i < arr.length; i++) {
          arr[i] = "http://iwenwiki.com/api/" + String(arr[i]).slice(24);
        }
        this.imgArr = arr;
      }
    });
  },
};
</script>

<style lang="less" scoped>
.wrap {
  width: 1200px;
  margin: 0 auto;
}
.else-box {
  background: #f5f5f5;
  overflow: hidden;
  padding: 50px 0 100px;
  .else-img {
    float: left;
    width: 300px;
    height: 200px;
    img {
      width: 300px;
      height: 200px;
    }
  }
}
</style>